#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableSailorSkillExtDao:DaoBase<TableSailorSkillExt>
    {
        public override string GetFileName()
        {
            return "TableSailorSkillExt.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableSailorSkillExt>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddTwoIndex(TableSailorSkillExt model)
        {
            string key = GetUnionKey(model.skillId.ToString(),model.fashionId.ToString());
            if (!cacheTwoIndex.ContainsKey(key))
            {
                cacheTwoIndex[key] = new List<TableSailorSkillExt>();
            }
            cacheTwoIndex[key].Add(model);
        }
        public override void AddPrimaryIndex(TableSailorSkillExt model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.id)) UnityEngine.Debug.LogError("数据表id重复:TableSailorSkillExt->id: " + model.id);
            #endif
            cachePrimaryInt[model.id] = model;
        }
        protected override TableSailorSkillExt ParseRowData(string[] rowData)
        {
            TableSailorSkillExt data = new TableSailorSkillExt();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.id = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.skillId = int.Parse(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.fashionId = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.Effects = ParseData<int>(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.EffBones = ParseStringIntern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.WEffects = ParseData<int>(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.WEffBones = ParseData(rowData[6]);
            }
            return data;
        }
    }
}
